package com.example.design.mediator;

/**
 * 闹钟，具体同事类
 * @author hej
 * @date 2022/11/4 17:33
 */
public class Alarm extends Colleague{
    public Alarm(Mediator mediator, String name) {
        super(mediator, name);
        mediator.register(name,this);
    }

    @Override
    void sendMessage(int stateChange) {
        this.getMediator().getMessage(stateChange,this.getName());
    }

    void sendAlarm(int statChange){
        sendMessage(0);
    }
}
